package org.idontknow.blocks;

import org.apache.log4j.Logger;

class Block {
	public static Logger log = Logger.getLogger(Block.class.getName());

	private int value;

	private int stackId;

	private int posInStack;

	Block(int _value, int _stackId, int _posInStack) {
		log.debug("Constructing a block: value=" + _value + ", in stack "
				+ _stackId + " at position " + _posInStack);
		value = _value;
		stackId = _stackId;
		posInStack = _posInStack;
	}

	public int getStackId() {
		return stackId;
	}

	public int getPosInStack() {
		return posInStack;
	}

	public int getValue() {
		return value;
	}

	public void set(int newId, int newPos) {
		log.debug("Block " + value + " is being moved from stack " + stackId
				+ "(@" + posInStack + ")" + " to stack " + newId + "(@"
				+ newPos + ")");
		stackId = newId;
		posInStack = newPos;
	}
}
